home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office deutch / INFOPATH.NL-NL / INFLR.CAB / TRAVELRE.XSN_1043 / upgrade.xsl < prev    next >
Extensible Markup Language  |  2006-11-12  |  7KB  |  199 lines

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-10-21T21:12:27" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" version="1.0">
  3.     <xsl:output encoding="UTF-8" method="xml"/>
  4.     <xsl:template match="text() | *[namespace-uri()='http://www.w3.org/1999/xhtml']" mode="RichText">
  5.         <xsl:copy-of select="."/>
  6.     </xsl:template>
  7.     <xsl:template match="/">
  8.         <xsl:copy-of select="processing-instruction() | comment()"/>
  9.         <xsl:choose>
  10.             <xsl:when test="my:travelRequest">
  11.                 <xsl:apply-templates select="my:travelRequest" mode="_0"/>
  12.             </xsl:when>
  13.             <xsl:otherwise>
  14.                 <xsl:variable name="var">
  15.                     <xsl:element name="my:travelRequest"/>
  16.                 </xsl:variable>
  17.                 <xsl:apply-templates select="msxsl:node-set($var)/*" mode="_0"/>
  18.             </xsl:otherwise>
  19.         </xsl:choose>
  20.     </xsl:template>
  21.     <xsl:template match="my:roundTrip" mode="_3">
  22.         <xsl:copy>
  23.             <xsl:element name="my:returnDate">
  24.                 <xsl:choose>
  25.                     <xsl:when test="my:returnDate/text()[1]">
  26.                         <xsl:copy-of select="my:returnDate/text()[1]"/>
  27.                     </xsl:when>
  28.                     <xsl:otherwise>
  29.                         <xsl:attribute name="xsi:nil">true</xsl:attribute>
  30.                     </xsl:otherwise>
  31.                 </xsl:choose>
  32.             </xsl:element>
  33.             <xsl:element name="my:returnTime">
  34.                 <xsl:choose>
  35.                     <xsl:when test="my:returnTime">
  36.                         <xsl:copy-of select="my:returnTime/text()[1]"/>
  37.                     </xsl:when>
  38.                     <xsl:otherwise>Anytime</xsl:otherwise>
  39.                 </xsl:choose>
  40.             </xsl:element>
  41.         </xsl:copy>
  42.     </xsl:template>
  43.     <xsl:template match="my:trip" mode="_2">
  44.         <xsl:copy>
  45.             <xsl:element name="my:departureLocation">
  46.                 <xsl:copy-of select="my:departureLocation/text()[1]"/>
  47.             </xsl:element>
  48.             <xsl:element name="my:destination">
  49.                 <xsl:copy-of select="my:destination/text()[1]"/>
  50.             </xsl:element>
  51.             <xsl:element name="my:departureDate">
  52.                 <xsl:choose>
  53.                     <xsl:when test="my:departureDate/text()[1]">
  54.                         <xsl:copy-of select="my:departureDate/text()[1]"/>
  55.                     </xsl:when>
  56.                     <xsl:otherwise>
  57.                         <xsl:attribute name="xsi:nil">true</xsl:attribute>
  58.                     </xsl:otherwise>
  59.                 </xsl:choose>
  60.             </xsl:element>
  61.             <xsl:element name="my:departureTime">
  62.                 <xsl:choose>
  63.                     <xsl:when test="my:departureTime">
  64.                         <xsl:copy-of select="my:departureTime/text()[1]"/>
  65.                     </xsl:when>
  66.                     <xsl:otherwise>Anytime</xsl:otherwise>
  67.                 </xsl:choose>
  68.             </xsl:element>
  69.             <xsl:element name="my:isRoundTrip">
  70.                 <xsl:choose>
  71.                     <xsl:when test="my:isRoundTrip/text()[1]">
  72.                         <xsl:copy-of select="my:isRoundTrip/text()[1]"/>
  73.                     </xsl:when>
  74.                     <xsl:otherwise>false</xsl:otherwise>
  75.                 </xsl:choose>
  76.             </xsl:element>
  77.             <xsl:choose>
  78.                 <xsl:when test="my:roundTrip">
  79.                     <xsl:apply-templates select="my:roundTrip[1]" mode="_3"/>
  80.                 </xsl:when>
  81.                 <xsl:otherwise>
  82.                     <xsl:variable name="var">
  83.                         <xsl:element name="my:roundTrip"/>
  84.                     </xsl:variable>
  85.                     <xsl:apply-templates select="msxsl:node-set($var)/*" mode="_3"/>
  86.                 </xsl:otherwise>
  87.             </xsl:choose>
  88.             <xsl:element name="my:includeHotel">
  89.                 <xsl:choose>
  90.                     <xsl:when test="my:includeHotel/text()[1]">
  91.                         <xsl:copy-of select="my:includeHotel/text()[1]"/>
  92.                     </xsl:when>
  93.                     <xsl:otherwise>false</xsl:otherwise>
  94.                 </xsl:choose>
  95.             </xsl:element>
  96.             <xsl:element name="my:includeCar">
  97.                 <xsl:choose>
  98.                     <xsl:when test="my:includeCar/text()[1]">
  99.                         <xsl:copy-of select="my:includeCar/text()[1]"/>
  100.                     </xsl:when>
  101.                     <xsl:otherwise>false</xsl:otherwise>
  102.                 </xsl:choose>
  103.             </xsl:element>
  104.         </xsl:copy>
  105.     </xsl:template>
  106.     <xsl:template match="my:trips" mode="_1">
  107.         <xsl:copy>
  108.             <xsl:choose>
  109.                 <xsl:when test="my:trip">
  110.                     <xsl:apply-templates select="my:trip" mode="_2"/>
  111.                 </xsl:when>
  112.                 <xsl:otherwise>
  113.                     <xsl:variable name="var">
  114.                         <xsl:element name="my:trip"/>
  115.                     </xsl:variable>
  116.                     <xsl:apply-templates select="msxsl:node-set($var)/*" mode="_2"/>
  117.                 </xsl:otherwise>
  118.             </xsl:choose>
  119.         </xsl:copy>
  120.     </xsl:template>
  121.     <xsl:template match="my:preferences" mode="_4">
  122.         <xsl:copy>
  123.             <xsl:element name="my:tripClass">
  124.                 <xsl:copy-of select="my:tripClass/text()[1]"/>
  125.             </xsl:element>
  126.             <xsl:element name="my:seatLocation">
  127.                 <xsl:copy-of select="my:seatLocation/text()[1]"/>
  128.             </xsl:element>
  129.             <xsl:element name="my:carClass">
  130.                 <xsl:copy-of select="my:carClass/text()[1]"/>
  131.             </xsl:element>
  132.             <xsl:element name="my:nonSmokingRoom">
  133.                 <xsl:choose>
  134.                     <xsl:when test="my:nonSmokingRoom/text()[1]">
  135.                         <xsl:copy-of select="my:nonSmokingRoom/text()[1]"/>
  136.                     </xsl:when>
  137.                     <xsl:otherwise>false</xsl:otherwise>
  138.                 </xsl:choose>
  139.             </xsl:element>
  140.         </xsl:copy>
  141.     </xsl:template>
  142.     <xsl:template match="my:travelRequest" mode="_0">
  143.         <xsl:copy>
  144.             <xsl:element name="my:purpose">
  145.                 <xsl:copy-of select="my:purpose/text()[1]"/>
  146.             </xsl:element>
  147.             <xsl:element name="my:requestDate">
  148.                 <xsl:choose>
  149.                     <xsl:when test="my:requestDate/text()[1]">
  150.                         <xsl:copy-of select="my:requestDate/text()[1]"/>
  151.                     </xsl:when>
  152.                     <xsl:otherwise>
  153.                         <xsl:attribute name="xsi:nil">true</xsl:attribute>
  154.                     </xsl:otherwise>
  155.                 </xsl:choose>
  156.             </xsl:element>
  157.             <xsl:element name="my:name">
  158.                 <xsl:copy-of select="my:name/text()[1]"/>
  159.             </xsl:element>
  160.             <xsl:element name="my:email">
  161.                 <xsl:copy-of select="my:email/text()[1]"/>
  162.             </xsl:element>
  163.             <xsl:choose>
  164.                 <xsl:when test="my:trips">
  165.                     <xsl:apply-templates select="my:trips[1]" mode="_1"/>
  166.                 </xsl:when>
  167.                 <xsl:otherwise>
  168.                     <xsl:variable name="var">
  169.                         <xsl:element name="my:trips"/>
  170.                     </xsl:variable>
  171.                     <xsl:apply-templates select="msxsl:node-set($var)/*" mode="_1"/>
  172.                 </xsl:otherwise>
  173.             </xsl:choose>
  174.             <xsl:choose>
  175.                 <xsl:when test="my:preferences">
  176.                     <xsl:apply-templates select="my:preferences[1]" mode="_4"/>
  177.                 </xsl:when>
  178.                 <xsl:otherwise>
  179.                     <xsl:variable name="var">
  180.                         <xsl:element name="my:preferences"/>
  181.                     </xsl:variable>
  182.                     <xsl:apply-templates select="msxsl:node-set($var)/*" mode="_4"/>
  183.                 </xsl:otherwise>
  184.             </xsl:choose>
  185.             <xsl:element name="my:notes">
  186.                 <xsl:apply-templates select="my:notes/text() | my:notes/*[namespace-uri()='http://www.w3.org/1999/xhtml']" mode="RichText"/>
  187.             </xsl:element>
  188.             <xsl:element name="my:filterDepartureLocation">
  189.                 <xsl:copy-of select="my:filterDepartureLocation/text()[1]"/>
  190.             </xsl:element>
  191.             <xsl:element name="my:filterDestination">
  192.                 <xsl:copy-of select="my:filterDestination/text()[1]"/>
  193.             </xsl:element>
  194.             <xsl:element name="my:filterDepartureDate">
  195.                 <xsl:copy-of select="my:filterDepartureDate/text()[1]"/>
  196.             </xsl:element>
  197.         </xsl:copy>
  198.     </xsl:template>
  199. </xsl:stylesheet>